#include <vector>
#include <set>
#include <iostream>
#include <unordered_map>
using namespace std;

int minMoves(vector<int>& nums) {
    int min = nums[0];
    for(int num : nums){
        if(min > num){ min = num; }
    }
    int ret = 0;
    for (int num : nums) {
        ret += num - min;
    }
    return ret;
}

int main(){
    vector<int> nums = { 1,2,3 };
    cout << minMoves(nums) << endl;
    return 0;
}